home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 10551 < prev    next >
Encoding:
Text File  |  1996-08-05  |  764 b   |  30 lines

  1. Path: news.clark.net!not-for-mail
  2. From: gusty@clark.net (Harlan Messinger)
  3. Newsgroups: comp.lang.c++
  4. Subject: Static Local Variable in Non-Static Member Function
  5. Date: 8 Mar 1996 16:45:32 GMT
  6. Organization: Clark Internet Services, Inc., Ellicott City, MD USA
  7. Message-ID: <4hpo7c$9qv@clarknet.clark.net>
  8. NNTP-Posting-Host: explorer.clark.net
  9. Mime-Version: 1.0
  10. Content-Type: TEXT/PLAIN; charset=ISO-8859-1
  11. Content-Transfer-Encoding: 8bit
  12. X-Newsreader: TIN [UNIX 1.3 950726BETA PL0]
  13.  
  14. Suppose we have
  15.  
  16.     class Foo {
  17.         ...
  18.         void func() {
  19.             static int flag;
  20.             ...
  21.         }
  22.     };
  23.  
  24.     Foo a, b;
  25.  
  26. Is flag in a.func() the same as flag in b.func(), or do a.func() and 
  27. b.func() have their own separate static locals named flag? That is, is 
  28. flag static or non-static to the class?
  29.  
  30.